package cn.edu.yzu.scholarship.validator;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

public class FreezeStudentValidator extends Validator {

	@Override
	protected void validate(Controller c) {
		this.validateRequired("startdate", "errorInfo", "起始时间不能为空！");
		this.validateRequired("enddate", "errorInfo", "结束时间不能为空！");
		this.validateRequired("xhs", "errorInfo", "学生列表不能为空！");
		this.validateDate("startdate", "1900-01-01", c.getPara("enddate"), "errorInfo", "时间范围不正确，起始时间不能大于结束时间，请确认后提交！");
	}

	@Override
	protected void handleError(Controller c) {
		c.renderJson("errorInfo",c.getAttr("errorInfo"));
	}

}
